package net.atomarrow.db.tx;

import java.util.ArrayList;
import java.util.List;

import net.atomarrow.configs.Config;

public class TransactionConfig {

	private List<String> needTxPrefixs;
	public TransactionConfig() {
		needTxPrefixs=new ArrayList<String>();
	}
	
	public void addNeedTxPrefix(String prefix){
		needTxPrefixs.add(prefix);
	}

	public List<String> getNeedTxPrefixs() {
		return needTxPrefixs;
	}

	public void setNeedTxPrefixs(List<String> needTxPrefixs) {
		this.needTxPrefixs = needTxPrefixs;
	}
	
	public void loadConfig(Config config){
	    List<String> configPrefixs=config.configTxPrefix();
	    if(configPrefixs!=null&&configPrefixs.size()!=0){
	        needTxPrefixs.addAll(configPrefixs);
	    }
	}
	
}
